class Solution:
    def numSub(self, s: str) -> int:
        oneStrs = s.split('0')
        result = 0
        for oneStr in oneStrs:
            result += len(oneStr) * (len(oneStr) + 1) // 2
        result %= 1000000007
        return result
